import Vue from 'vue'
import Router from 'vue-router'
const _import = require('../_import_' + process.env.NODE_ENV)

// import staticRoutes from './static_route/static'
// in development env not use Lazy Loading,because Lazy Loading too many pages will cause webpack hot update too slow.so only in production use Lazy Loading

/* layout */
import Layout from '../../views/layout/Layout'

Vue.use(Router)

/**
* icon : the icon show in the sidebar
* hidden : if `hidden:true` will not show in the sidebar
* redirect : if `redirect:noredirect` will not redirct in the levelbar
* noDropdown : if `noDropdown:true` will not has submenu in the sidebar
* meta : `{ role: ['admin'] }`  will control the page role
**/
export const constantRouterMap = [
  {
    path: '/page',
    component: Layout,
    redirect: '/page/Console',
    icon: 'el-icon-menu',
    noDropdown: true,
    children: [{ path: 'Console', name: '控制台', component: _import('page/Console/Console') }]
  },
  {
    path: '/page',
    component: Layout,
    redirect: '/page/AlertData',
    icon: 'el-icon-date',
    noDropdown: true,
    children: [{ path: 'AlertData', name: '历史警报列表', component: _import('page/AlertData/AlertData') }]
  },
  {
    path: '/page',
    component: Layout,
    redirect: '/page',
    icon: 'el-icon-setting',
    noDropdown: true,
    children: [
      { path: 'StationTerminalManager/', name: '分站终端管理', component: _import('page/StationTerminalManager/StationTerminalManager'), hidden: true },
      { path: 'StationTerminalManager/TerminalManager', name: '终端管理 ', component: _import('page/TerminalManager/TerminalManager'), hidden: true },
      { path: 'StationTerminalManager/TemperatureEquipmentData', name: '测温设备数据', component: _import('page/TemperatureEquipmentData/TemperatureEquipmentData'), hidden: true }
    ]
  },
  {
    path: '/page',
    component: Layout,
    redirect: '/page/UsersManager',
    icon: 'el-icon-date',
    noDropdown: true,
    admin: true,
    children: [{ path: 'UsersManager', name: '用户管理', component: _import('page/UsersManager/UsersManager') }]
  },
  {
    path: '/page',
    component: Layout,
    redirect: '/page/AreasManager',
    icon: 'el-icon-date',
    noDropdown: true,
    admin: true,
    children: [{ path: 'AreasManager', name: '地区', component: _import('page/AreasManager/AreasManager') }]
  }

]
export default constantRouterMap
